<?php
/**
 * 定单列表管理模型
 * @author e5
 *
 */
class OrderListModel extends Model{
	public $table = "orderlist";
	/**
	 * 添加定单列表
	 * @param int $oid
	 */
	public function addOrderList($oid){
		$data = array();
		$cartData = Cart::getGoods();
		foreach ($cartData as $v){
			$data['quantity'] = $v['num'];
			$data['subtotal'] = $v['total'];
			$data['vshop_order_oid'] = $oid;
			$data['vshop_goodslist_glid'] = $v['id'];
			$this->add($data);
		}
		return true;
	}
}